package com.my.order.config;

import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;

/**
 * @author zhaodongchao
 * @date 2020/4/20 18:13
 */
@org.springframework.context.annotation.Configuration
@MapperScan(basePackages = {"com.my.order.mapper"})
public class MybatisConfig implements ConfigurationCustomizer {

    @Override
    public void customize(Configuration configuration) {
        //驼峰映射 a_book  -> aBook
        configuration.setMapUnderscoreToCamelCase(true);
        //禁止缓存
        configuration.setCacheEnabled(false);
        //值为null时不调用setter方法
        configuration.setCallSettersOnNulls(false);

    }
}
